<?php
/**
 * Created by PhpStorm.
 * User: win7
 * Date: 2018/5/3
 * Time: 17:23
 */

namespace app\api\controller;


class Product
{
    public function productList() {
        $productList = [
            [
                'product_name' => '测试商品1',
                'stock' => 100,
                'sale_count' => 102,
                'price' => 99.00,
                'id' => 1,
                'status' => 0
            ],
            [
                'product_name' => '测试商品2',
                'stock' => 100,
                'sale_count' => 102,
                'price' => 99.00,
                'id' => 1,
                'status' => 0
            ],
            [
                'product_name' => '测试商品一',
                'stock' => 100,
                'sale_count' => 102,
                'price' => 99.00,
                'id' => 1,
                'status' => 1
            ],
            [
                'product_name' => '测试商品二',
                'stock' => 100,
                'sale_count' => 102,
                'price' => 99.00,
                'id' => 1,
                'status' => 1
            ],
            [
                'product_name' => '测试商品-',
                'stock' => 100,
                'sale_count' => 102,
                'price' => 99.00,
                'id' => 1,
                'status' => 2
            ]
        ];
        $data = [
            'code' => 20000,
            'data' => $productList
        ];
        return json($data, 200);
    }
}